package com.taoyeshu.common.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @描述:分页类
 * @作者 :HuanGe
 * @创建日期 :2015年9月27日 上午12:22:49
 *
 */
public class PageResult<T> {
	private List<T> rows = new ArrayList<>();// 数据
	private int page;// 当前页
	private int records;// 总记录数
	@SuppressWarnings("unused")
	private int total;// 总页数
	private int pageSize;// 每页条数

	public PageResult() {
		super();
	}

	public PageResult(List<T> rows, int page, int records, int total, int pageSize) {
		super();
		this.rows = rows;
		this.page = page;
		this.records = records;
		this.total = total;
		this.pageSize = pageSize;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRecords() {
		return records;
	}

	public void setRecords(int records) {
		this.records = records;
	}

	public int getTotal() {
		return (records + pageSize - 1) / pageSize;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

}
